<?php
session_start();
$create_session="1234";
if($create_session==$_SESSION["create_session"]){
$user_id=$_SESSION['user'];
}
else{
echo"
<script>
document.write(window.location='index.php');
</script>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Alvarmat Site</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="wrapper">

<div id="header-wrapper">
	<div id="logo">
		<h1><a href="index.php">Net-Son </a></h1>
		<p><em> by sfel</em></p>
	</div>
	<hr />
	<!-- end #logo -->
	<div id="header">
		<div id="menu">
			<ul>
				<li class="current_page_item"><a href="home.php">Home</a></li>
				<li><a href="#">Blog</a></li>
			</ul>
		</div>
		<!-- end #menu -->
		<div id="search">
			<form method="get" action="">
				<fieldset>
				<input type="text" name="s" id="search-text" size="15" />
				<input type="submit" id="search-submit" value="Search" />
				</fieldset>
			</form>
		</div>
		<!-- end #search -->
	</div>
	<!-- end #header -->
</div>
<!-- end #header-wrapper -->

<div id="page">
	<div id="content">
		<div class="post">
			<h2 class="title">Comentarios</h2>
			<div class="entry">
			<p> 
			<?php
			echo"
			<table>
				<form id=form1 name=form1 method=post action=upload_comments.php align=left>
				<tr>
				<td>
				<input name=user_id type=textField id=user_id  value=$user_id />
				</td>
				</tr>
				<tr>
				<td>
				<font color=white> <label>Comentarios:</font></label>
				</td>
				</tr>
				<tr>
				<td>
				<input name=comment type=textArea id=comment  style='width: 500px; height: 40px';/>
				</td>
				</tr>
				<tr>
				<td>
				<input type=submit value=Aceptar name=B1></td>
				</td>
				</tr>		
				</form>
			</table>";?>
			</p>
			</div>
			
			<div class="entry">
				<p>
				<?php
					include("admin/cls/cls_user.php");
					$user = new cls_user ();
					$var=$user->getComments2();
					//$data=$user->getUserData($user_id);
					//echo $query;
					echo "<table align=center border=0 bgcolor=#ffffff cellspacing=5 bordercolor=red  style='width:550px;'>";
					echo "<TR>";
					echo " <th><font color=blue>&nbsp;Imagen</font></font></th>";
					echo " <th><font color=blue>&nbsp;Email </font></font></th>";
					echo "<th><font color=blue>&nbsp;Comentarios</font></th>";
					echo "</TR>";

					while($reg = mysql_fetch_array($var)){
					echo "<tr>";
					echo "<td>";
					$val=$user->getImageProfile($reg["user_id"]);
					while($mostrar = mysql_fetch_array($val)){
					$image_id=$mostrar['image_id'];
					}
					//echo "<a href='files_users/$image_name'>";
					echo "<img src='getImages.php?image_id=$image_id'></a>";
					
					echo "</td>";
					echo "<td>";
					echo "<font color=black>";
					echo $reg["email"];
					echo "</font>";
					echo "</td>";

					echo "<td>";
					echo "<font color=black>";
					echo $reg["content"];
					echo "</font>";
					echo "</td>";

					echo "</tr>";

					}
					mysql_free_result($var);
					echo "</table>";
					?>
				</p>
				
			</div>
		</div>
	</div>
	<!-- end #content -->
	<div id="sidebar">
		<ul>
			<li>
				<h2>News</h2>
				<p>
					<?php
					/*
						$url="http://news.google.com/nwshp?hl=es&tab=wn";
						$ch = curl_init();
						curl_setopt ($ch, CURLOPT_URL,$url);
						curl_setopt ($ch, CURLOPT_HEADER, 0);
						curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
						$page = trim(curl_exec($ch));
						$pos2=strpos($page,'<div class="small-section section-itn" id="s_1"><');
						$pos1=strpos($page,'ltimas noticias');
						$longitud=strlen($page);
						$puntuacion=substr($page,$pos1+15,$pos2-($longitud+49));
						echo $puntuacion;*/
					?>.
				</p>
			</li>
			<li>
				<h2>Turpis nulla</h2>
				<ul>
					<li><a href="http://www.google.com">Google</a></li>
					<li><a href="http://www.facebook.com">Facebook</a></li>
					<li><a href="http://www.twitter.com">Twitter</a></li>
					<li><a href="http://www.sfel.net63.net">Servicios Computacionales</a></li>
					<li><a href="http://www.felcorp.com">otro</a></li>
					<li></li>
				</ul>
			</li>
		</ul>
	</div>
	<!-- end #sidebar -->
	<div style="clear: both;">&nbsp;</div>
</div>
<!-- end #page -->

<div id="footer">
	<p>Copyright (c) 2008 Sitename.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
</div>
<!-- end #footer -->
</div>
</body>
</html>
